import request from '@/utils/request'

/**新增部门
 * @param {code,introduce,manager,name,pid} data
 */
export function addDepartments(data){
  return request({
    url:'/company/department',
    method:'post',
    data
  })
}
/**查询企业的部门列表
 * @param {} 
 */
 export function getDepartments(){
  return request({
    url:'/company/department',
  })
}
/**根据ID修改部门详情
 * @param {code,introduce,manager,name,pid} data
 */
 export function updateDepartments(data){
  return request({
    url:`/company/department/${data.id}`,
    method:'put',
    data
  })
}
/**根据ID删除部门
 * @param {id} 
 */
 export function delDepartments(id){
  return request({
    url:`/company/department/${id}`,
    method:'delete',
  })
}
/**根据ID查询部门详情
 * @param {id} 
 */
 export function chakDepartments(id){
  return request({
    url:`/company/department/${id}`,
  })
}